<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
<%@ taglib prefix="s" uri="/struts-tags"%>
<%
	String path = request.getContextPath();
	String basePath = request.getScheme() + "://"
			+ request.getServerName() + ":" + request.getServerPort()
			+ path + "/";
%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" >

<html>
<head>
<base href="<%=basePath%>">

<title>用户注册</title>
<meta http-equiv="pragma" content="no-cache">
<meta http-equiv="cache-control" content="no-cache">
<meta http-equiv="expires" content="0">
<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
<meta http-equiv="description" content="This is my page">

<link href="css/skin.css" rel="stylesheet" type="text/css">

<style type="text/css">
body {
	margin-left: 0px;
	margin-top: 0px;
	margin-right: 0px;
	margin-bottom: 0px;
	background-color: #1D3647;
</style>

<script type="text/javascript">
function mycheck(){
		if(myform.user.value == ""){
			alert("登录名不能为空！");
			myform.user.focus();
			return false;
		}
		if(myform.pass.value == ""){
			alert("密码不能为空！");
			myform.pass.focus();
			return false;
		}else{
			if(myform.pass.value != myform.repass.value){
				alert("输入两次密码不同！");
				myform.pass.focus();
				return false;
			}
		}
		if(myform.orgid.value == 0){
		 alert("请填写公司授权码");
		 myform.orgid.focus();
		 return false;
		}
		if(myform.email.value != ""){
			reg=/^([a-zA-Z0-9]+[_|\-|\.]?)*[a-zA-Z0-9]+@([a-zA-Z0-9]+[_|\-|\.]?)*[a-zA-Z0-9]+\.[a-zA-Z]{2,3}$/gi;
    		if(!reg.test(myform.email.value))
    		{
        		alert("非法的电子邮件");
        		myform.email.focus();
        		return false;
    		}
		}
		if(myform.phone.value != ""){
			var tel = /(^[0-9]{3,4}\-[0-9]{7,8}$)|(^[0-9]{7,8}$)|(^\([0-9]{3,4}\)[0-9]{3,8}$)|(^0{0,1}13[0-9]{9}$)|(13\d{9}$)|(15[0135-9]\d{8}$)|(18[267]\d{8}$)/;
			var number = myform.phone.value; 
			if(!(/^1[3|4|5|8][0-9]\d{4,8}$/.test(number))){
				if(number != "" && number.replace(/\s/g,"")!="" && !(tel.exec(number))){
    				alert("联系方式有误");
    				myform.phone.focus();
    				return false;
				}
        	}
        }
	}
</script>

</head>

<body>
	<table width="100%" height="166" border="0" cellpadding="0"
		cellspacing="0">
		<tr>
			<td height="42" valign="top"><table width="100%" height="42"
					border="0" cellpadding="0" cellspacing="0" class="login_top_bg">
					<tr>
						<td width="1%" height="21">&nbsp;</td>
						<td height="42">&nbsp;</td>
						<td width="17%">&nbsp;</td>
					</tr>
				</table>
			</td>
		</tr>
		<tr>
			<td>
				<table width="100%" height="550" border="0" cellpadding="0"
					cellspacing="0" class="login_bg">
					<tr>
						<td width="35%">&nbsp;</td>
						<td>
							<form action="register" method="post" name="myform">
								<table cellSpacing="0" cellPadding="0" width="100%" border="0"
									height="143" id="table212">
									<tr>
										<td width="30%" height="38" class="top_hui_text"><span
											class="login_txt">登录名：&nbsp;&nbsp; </span>
										</td>
										<td height="38" colspan="2" class="top_hui_text"><input
											type="text" name="user.user" id="user" class="editbox4"
											size="20">
										</td>
									</tr>
									<tr>
										<td width="13%" height="38" class="top_hui_text"><span
											class="login_txt">密&nbsp;&nbsp;码：&nbsp;&nbsp; </span>
										</td>
										<td height="38" colspan="2" class="top_hui_text"><input
											type="password" name="user.pass" id="pass" class="editbox4"
											size="20">
										</td>
									</tr>
									<tr>
										<td width="13%" height="38" class="top_hui_text"><span
											class="login_txt">再次输入：&nbsp; </span>
										</td>
										<td height="38" colspan="2" class="top_hui_text"><input
											type="password" name="user.repass" id="repass"
											class="editbox4" size="20">
										</td>
									</tr>
									<tr>
										<td width="13%" height="38" class="top_hui_text"><span
											class="login_txt">邮&nbsp;&nbsp;箱：&nbsp;&nbsp; </span>
										</td>
										<td height="38" colspan="2" class="top_hui_text"><input
											type="text" name="user.email" id="email" class="editbox4"
											size="20">
										</td>
									</tr>
									<tr>
										<td width="13%" height="38" class="top_hui_text"><span
											class="login_txt">真&nbsp;&nbsp;名：&nbsp;&nbsp;</span>
										</td>
										<td height="38" colspan="2" class="top_hui_text"><input
											type="text" name="user.name" id="name" class="editbox4"
											size="20">
										</td>
									</tr>
									<tr>
										<td width="13%" height="38" class="top_hui_text"><span
											class="login_txt">联系方式：&nbsp; </span>
										</td>
										<td height="38" colspan="2" class="top_hui_text"><input
											type="text" name="user.phone" id="phone" class="editbox4"
											size="20">
										</td>
									</tr>
									<tr>
										<td width="13%" height="38" class="top_hui_text"><span
											class="login_txt">授权码：&nbsp;&nbsp; </span>
										</td>
										<td height="38" colspan="2" class="top_hui_text"><input
											type="text" name="user.orgid" id="orgid" value="0"
											class="editbox4" size="20">
										</td>
									</tr>
									<tr>
										<td height="35" colspan="2">&nbsp;</td>
										<td width="20%" height="35"><input name="Submit"
											type="submit" class="button" id="Submit" value="确 认"
											onClick="return mycheck();" />
										</td>
									</tr>
									<tr>
										<td height="35" colspan="2" class="top_hui_text"
											align="center"><span class="errorAndmes"><s:actionerror
													cssStyle="font-family: Arial,Helvetica,sans-serif" /> </span>
										</td>
									</tr>
								</table>
							</form>
						</td>
						<td width="35%">&nbsp;</td>
					</tr>
				</table>
			</td>
		</tr>
		<tr>
			<td height="20"><table width="100%" border="0" cellspacing="0"
					cellpadding="0" class="login-buttom-bg">
					<tr>
						<td align="center">&nbsp;</td>
					</tr>
				</table>
			</td>
		</tr>
	</table>
</body>
</html>
